%module OgreSharedPtr

%{
#include "OGRE/OgreSharedPtr.h"
	%}

namespace Ogre {

	template<class T> class SharedPtr
	{
	public:
		SharedPtr& operator=(const SharedPtr& r);

		SharedPtr& operator=(const SharedPtr<Y>& r);

		inline T& operator*() const { assert(pRep); return *pRep; }
		inline T* operator->() const { assert(pRep); return pRep; }
		inline T* get() const { return pRep; }

		inline T* getPointer() const { return pRep; }
		inline bool isNull(void) const { return pRep == 0; }

		inline void setNull(void);
	};

	template<class T, class U> inline bool operator==(SharedPtr<T> const& a, SharedPtr<U> const& b)
	{
		return a.get() == b.get();
	}

	template<class T, class U> inline bool operator!=(SharedPtr<T> const& a, SharedPtr<U> const& b)
	{
		return a.get() != b.get();
	}

	template<class T, class U> inline bool operator<(SharedPtr<T> const& a, SharedPtr<U> const& b)
	{
		return std::less<const void*>()(a.get(), b.get());
	}

}
